package com.dyz.leetcode._01_array;

public class _344_reverseString {
    //双指针两端夹击
    public void reverseString(char[] s) {
        int n = s.length;
        if(n<=1){return;}
        int left = 0;
        int right = n-1;
        while(left<right){
            char temp = s[left];
            s[left] = s[right];
            s[right] = temp;
            left++;
            right--;
        }
    }
}
